package com.study.base.io.nio.reactor;

import java.io.IOException;

/**
 * Created by tan on 2017/7/14.
 */
public class Server {
    public static void main(String[] args) throws IOException {

        Reactor reactor = new Reactor(82);
        Thread reactorThread = new Thread(reactor);
        reactorThread.start();
        Thread thread = new Thread(() -> {
            try {
                Thread.sleep(10);
                //中断selector.selector()方法所在线程
                reactorThread.interrupt();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        thread.start();
    }
}
